package com.jiabo.mapper;

import com.jiabo.pojo.Role;
import com.jiabo.pojo.User;
import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@CacheNamespace
public interface IUserMapper {
    List<User> findAll();

    List<User> findAllUserAndRole();

    @Insert("insert into user values(#{id},#{username})")
    void addUser(User user);

    @Select("select * from user where id = #{id}")
    User findUserById(Integer id);
}
